
import java.util.List;
import java.util.concurrent.TimeUnit;

import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;

import org.junit.Test;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

public class checkboxcheck {

	@Test
	public void sample() throws InterruptedException{
		
	
	FirefoxDriver driver = new FirefoxDriver();
	driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
	driver.get("https://www.facebook.com");	
	WebElement mycheckbox = driver.findElement(By.id("persist_box"));
	for (int i=1; i<=15; i++){
		if(mycheckbox.isSelected()){
		System.out.println("The checkbox is selected");
			mycheckbox.click();
		} else{
			System.out.println("The checkbox is not selected");
			mycheckbox.click();
		}
			
	}
driver.quit();	
}
}
